package com.ruoyi.material.mapper;

import java.util.List;
import java.util.Map;

import com.ruoyi.material.domain.MateriaPurchaseRecord;
import org.apache.ibatis.annotations.Param;

/**
 * 材料采购记录Mapper接口
 *
 * @author liboyu
 * @date 2024-06-16
 */
public interface MateriaPurchaseRecordMapper {


    int deleteByPrimaryKey(Long id);

    int insert(MateriaPurchaseRecord record);
    public MateriaPurchaseRecord selectMateriaPurchaseRecordByPurchaseRecordId(Long purchaseRecordId);

    /**
     * 查询材料采购记录列表
     *
     * @param materiaPurchaseRecord 材料采购记录
     * @return 材料采购记录集合
     */
    public List<MateriaPurchaseRecord> selectMateriaPurchaseRecordList(MateriaPurchaseRecord materiaPurchaseRecord);

    /**
     * 新增材料采购记录
     *
     * @param materiaPurchaseRecord 材料采购记录
     * @return 结果
     */
    public int insertMateriaPurchaseRecord(MateriaPurchaseRecord materiaPurchaseRecord);

    /**
     * 修改材料采购记录
     *
     * @param materiaPurchaseRecord 材料采购记录
     * @return 结果
     */
    public int updateMateriaPurchaseRecord(MateriaPurchaseRecord materiaPurchaseRecord);

    /**
     * 删除材料采购记录
     *
     * @param purchaseRecordId 材料采购记录主键
     * @return 结果
     */
    public int deleteMateriaPurchaseRecordByPurchaseRecordId(Long purchaseRecordId);

    Long hasData(@Param("materiaIds") Long[] materiaIds);
    /**
     * 批量删除材料采购记录
     *
     * @param purchaseRecordIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteMateriaPurchaseRecordByPurchaseRecordIds(Long[] purchaseRecordIds);

    int updateAlreadyQuantity(MateriaPurchaseRecord materiaPurchaseRecord);

    List<Map<String, Object>> selectProcurementByProjectId(Long projectId);
}
